package com.crape.topic.bo;

import java.util.List;

import com.crape.common.exceptions.BOException;
import com.crape.common.model.Article;
import com.crape.common.model.ArticleComment;
import com.crape.common.model.ArticleReply;

public interface IArticleBO {
	
	List<Article> searchArticles(String searchValue, Integer startIndex, Integer pageSize) throws BOException;

	Long countSearchArticles(String searchValue) throws BOException;

	List<Article> getArticles(Article article) throws BOException;

	List<Article> getAllArticles(Integer startIndex, Integer pageSize) throws BOException;

	Long countAllArticles() throws BOException;

	List<Article> getArticlesByAccountid(Long accountid, Integer startIndex, Integer pageSize) throws BOException;

	Long countArticlesByAccountid(Long accountid) throws BOException;

	List<Article> getCommentArticlesByAccountid(Long accountid, Integer startIndex, Integer pageSize) throws BOException;

	Long countArticleCommentsByAccountid(Long accountid) throws BOException;

	List<Article> getArticlesBySubjectid(Long subjectid, Integer startIndex, Integer pageSize) throws BOException;

	Long countArticlesBySubjectid(Long subjectid) throws BOException;

	List<Article> getHotArticles() throws BOException;

	Article getArticleId(Long id) throws BOException;

	Article getArticleDetailId(Long id) throws BOException;

	List<Article> getNext4Articles(Long subjectid, Long articleid) throws BOException;

	List<Article> getAuthorOtherArticles(Long accountid, Long articleid) throws BOException;
	
	List<Article> getSubjectOtherArticles(Long subjectid, Long articleid) throws BOException;

	List<ArticleComment> getArticleCommentByArticleId(Long articleid, Integer startIndex, Integer pageSize);

	ArticleComment getLatestArticleCommentByaccountId(Long accountid, Long articleid);
	
	void addArticle(Article article) throws BOException;

	void updateArticle(Article article) throws BOException;

	void updateArticleStatus(Long accountid, Long articleid, Integer status) throws BOException;

	void deleteArticleById(Long id) throws BOException;
	
	void addComment(ArticleComment articleComment);

	void addReply(ArticleReply articleReply);
	
	void addVisitor(Long accountid, Long articleid);
	
}
